import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm'; // 链接数据库使用
import { AppController } from './app.controller';
import { AppService } from './app.service';

import { UserModule } from './user/user.module';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: '81.68.115.22',
      port: 3306,
      username: 'wangfangyuan',
      password: 'Wfy123456!',
      database: 'wangfangyuan',
      entities: [__dirname + '/**/*.entity{.ts,.js}'],
      synchronize: true,
    }),
    UserModule
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
